<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><script type="text/javascript" src="https://cdn.jsdelivr.net/gh/opencobra/cobratoolbox@ffa0229fc0c01c9236bb7e961f65712443277719/latest/_static/js/iframeResizer.contentWindow.min.js"></script><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB 2021a"><title>OptGene Tutorial</title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: normal; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: normal; text-align: left;  }
.S1 { margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S2 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S3 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S4 { margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  }
.S5 { margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: normal;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S6 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S7 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S8 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S9 { color: rgb(64, 64, 64); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;  }
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsErrorElement.inlineElement {}
.embeddedOutputsErrorElement.rightPaneElement {}
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsWarningElement.inlineElement {}
.embeddedOutputsWarningElement.rightPaneElement {}
/* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;}
.diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);}
.diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;}
.diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);}
.diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;}
.diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: normal;}
.diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: normal;}
.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: normal;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;}
.textElement,.rtcDataTipElement .textElement {    padding-top: 3px;}
.embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {}
.inlineElement .textElement {}
.embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;}
.rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}
.S10 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S11 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S12 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S13 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S14 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span>OptGene Tutorial</span></h1><h2  class = 'S1'><span>Author: Sebastián N. Mendoza,  Center for Mathematical Modeling, University of Chile. snmendoz@uc.cl</span></h2><h2  class = 'S1'><span style=' font-weight: bold;'>Reviewer(s): Sylvian Arreckx</span></h2><h2  class = 'S1'><span style=' font-weight: bold;'>INTRODUCTION:</span></h2><div  class = 'S2'><span>In this tutorial we will run optGene For a detailed description of the procedure, please see [1]. Briefly, the problem is to find a set of reactions of size "K" such that when these reactions are deleted from the model, the mutant created will produce a particular target of interest in a higher rate than the wild-type strain. </span></div><div  class = 'S2'><span>For example, imagine that we would like to increase the production of succinate in Escherichia coli. Which are the knockouts needed to increase the production of succinate? We will approach this problem in this tutorial.</span></div><h2  class = 'S3'><span>MATERIALS</span></h2><h2  class = 'S1'><span>EQUIPMENT</span></h2><ol  class = 'S4'><li  class = 'S5'><span>MATLAB</span></li><li  class = 'S5'><span>A solver for QP problems. For example, Gurobi. I encourage the users to use Gurobi since I've not obtained good results using glpk.</span></li></ol><h2  class = 'S1'><span style=' font-weight: bold;'>EQUIPMENT SETUP</span></h2><div  class = 'S2'><span>Use changeCobraSolver to choose the solver for QP problems. </span></div><h2  class = 'S3'><span>PROCEDURE</span></h2><div  class = 'S2'><span>The proceduce consists on the following steps</span></div><div  class = 'S2'><span>1) Define contraints (manual task)</span></div><div  class = 'S2'><span>2) Select a list of reactions or genes (manual task). Reactions or genes in this list could be deleted. Elements that are not in the list will no be deleted. </span></div><div  class = 'S2'><span>3) Define some (manual task)</span></div><div  class = 'S2'><span>4) Run optGene. </span><span style=' font-weight: bold;'>TIMING</span><span>: This task should take from a few minutes to a few days, depending on the size of your reconstruction and the criterion for stoping optGene</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">global </span><span >TUTORIAL_INIT_CB;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">if </span><span >~isempty(TUTORIAL_INIT_CB) &amp;&amp; TUTORIAL_INIT_CB  ==  1</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    initCobraToolbox(false) </span><span style="color: rgb(2, 128, 9);">% false, as we don't want to update</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    changeCobraSolver(</span><span style="color: rgb(170, 4, 249);">'gurobi'</span><span >, </span><span style="color: rgb(170, 4, 249);">'all'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fullPath = which (</span><span style="color: rgb(170, 4, 249);">'tutorial_optGene.mlx'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >folder = fileparts(fullPath);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >cd(folder);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >threshold = 3; </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span >model = readCbModel(</span><span style="color: rgb(170, 4, 249);">'iJO1366.mat'</span><span >);</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="2144F3F9" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="18" data-hashorizontaloverflow="true" data-testid="output_0" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">Each model.subSystems{x} is a character array, and this format is retained.</div></div></div></div><div class="inlineWrapper"><div  class = 'S10'><span style="white-space: normal"><span >biomass = </span><span style="color: rgb(170, 4, 249);">'BIOMASS_Ec_iJO1366_core_53p95M'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%SETTING SPECIFIC CONSTRAINTS</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% prespecified amount of glucose uptake 10 mmol/grDW*hr</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_glc__D_e'</span><span >, -10, </span><span style="color: rgb(170, 4, 249);">'b'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Unconstrained uptake routes for inorganic phosphate, sulfate and</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% ammonia</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_o2_e'</span><span >, 0, </span><span style="color: rgb(170, 4, 249);">'l'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_pi_e'</span><span >, -1000, </span><span style="color: rgb(170, 4, 249);">'l'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_so4_e'</span><span >, -1000, </span><span style="color: rgb(170, 4, 249);">'l'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_nh4_e'</span><span >, -1000, </span><span style="color: rgb(170, 4, 249);">'l'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% The optimization step could opt for or against the phosphotransferase</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% system, glucokinase, or both mechanisms for the uptake of glucose</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'GLCabcpp'</span><span >, -1000, </span><span style="color: rgb(170, 4, 249);">'l'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'GLCptspp'</span><span >, -1000, </span><span style="color: rgb(170, 4, 249);">'l'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'GLCabcpp'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'GLCptspp'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'GLCt2pp'</span><span >, 0, </span><span style="color: rgb(170, 4, 249);">'b'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Secretion routes  for acetate, carbon dioxide, ethanol, formate, lactate</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% and succinate are enabled</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_ac_e'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_co2_e'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_etoh_e'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_for_e'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_lac__D_e'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeRxnBounds(model, </span><span style="color: rgb(170, 4, 249);">'EX_succ_e'</span><span >, 1000, </span><span style="color: rgb(170, 4, 249);">'u'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% FINDING RATES IN WILD-TYPE</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% The follling rates are those calculated in the wild-type without any</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% mutation.</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% determine succinate production and growth rate before optimizacion</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fbaWT = optimizeCbModel(model);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >growthRateWT = fbaWT.f;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeObjective(model, </span><span style="color: rgb(170, 4, 249);">'EX_succ_e'</span><span >); </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fbaWTMin = optimizeCbModel(model, </span><span style="color: rgb(170, 4, 249);">'min'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >fbaWTMax = optimizeCbModel(model, </span><span style="color: rgb(170, 4, 249);">'max'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >minSuccFluxWT = fbaWTMin.f;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >maxSuccFluxWT = fbaWTMax.f;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >model = changeObjective(model, biomass);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'The minimum and maximum production of succinate before optimization is %.1f and %.1f respectively\n'</span><span >, minSuccFluxWT, maxSuccFluxWT);</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="422101E5" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="18" data-hashorizontaloverflow="true" data-testid="output_1" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">The minimum and maximum production of succinate before optimization is 0.0 and 15.8 respectively</div></div></div></div><div class="inlineWrapper outputs"><div  class = 'S11'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'The growth rate before optimization is %.2f \n'</span><span >, growthRateWT);</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="A69F108D" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="18" data-hashorizontaloverflow="false" data-testid="output_2" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">The growth rate before optimization is 0.24 </div></div></div></div><div class="inlineWrapper"><div  class = 'S10'></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% OPTGENE SETTING</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >selectedGeneList = {};</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% use prespecified reactions. Faster option</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >selectedRxnList = {</span><span style="color: rgb(170, 4, 249);">'GLCabcpp'</span><span >; </span><span style="color: rgb(170, 4, 249);">'GLCptspp'</span><span >; </span><span style="color: rgb(170, 4, 249);">'HEX1'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PGI'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PFK'</span><span >; </span><span style="color: rgb(170, 4, 249);">'FBA'</span><span >; </span><span style="color: rgb(170, 4, 249);">'TPI'</span><span >; </span><span style="color: rgb(170, 4, 249);">'GAPD'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PGK'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PGM'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ENO'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PYK'</span><span >; </span><span style="color: rgb(170, 4, 249);">'LDH_D'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PFL'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ALCD2x'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PTAr'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ACKr'</span><span >; </span><span style="color: rgb(170, 4, 249);">'G6PDH2r'</span><span >; </span><span style="color: rgb(170, 4, 249);">'PGL'</span><span >; </span><span style="color: rgb(170, 4, 249);">'GND'</span><span >; </span><span style="color: rgb(170, 4, 249);">'RPI'</span><span >; </span><span style="color: rgb(170, 4, 249);">'RPE'</span><span >; </span><span style="color: rgb(170, 4, 249);">'TKT1'</span><span >; </span><span style="color: rgb(170, 4, 249);">'TALA'</span><span >; </span><span style="color: rgb(170, 4, 249);">'TKT2'</span><span >; </span><span style="color: rgb(170, 4, 249);">'FUM'</span><span >; </span><span style="color: rgb(170, 4, 249);">'FRD2'</span><span >; </span><span style="color: rgb(170, 4, 249);">'SUCOAS'</span><span >; </span><span style="color: rgb(170, 4, 249);">'AKGDH'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ACONTa'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ACONTb'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ICDHyr'</span><span >; </span><span style="color: rgb(170, 4, 249);">'CS'</span><span >; </span><span style="color: rgb(170, 4, 249);">'MDH'</span><span >; </span><span style="color: rgb(170, 4, 249);">'MDH2'</span><span >; </span><span style="color: rgb(170, 4, 249);">'MDH3'</span><span >; </span><span style="color: rgb(170, 4, 249);">'ACALD'</span><span >};</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >genesByReaction = regexp(regexprep(model.grRules(ismember(model.rxns, selectedRxnList)), </span><span style="color: rgb(170, 4, 249);">'\or|and|\(|\)'</span><span >, </span><span style="color: rgb(170, 4, 249);">''</span><span >), </span><span style="color: rgb(170, 4, 249);">'\  '</span><span >, </span><span style="color: rgb(170, 4, 249);">'split'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:length(genesByReaction)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    selectedGeneList = union(selectedGeneList, genesByReaction{i});</span></span></div></div><div class="inlineWrapper"><div  class = 'S12'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div  class = 'S2'><span style=' font-weight: bold;'>I) SUCCINATE OVERPRODUCTION</span></div><div  class = 'S2'><span style=' font-weight: bold;'>EXAMPLE 1: finding reaction knockouts sets of large 2 or less, using a limit of time to stop optGene</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S13'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'\n...EXAMPLE 1: Finding optGene sets\n\n'</span><span >)</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="1E55B63C" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="18" data-hashorizontaloverflow="false" data-testid="output_3" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">...EXAMPLE 1: Finding optGene sets</div></div></div></div><div class="inlineWrapper"><div  class = 'S10'><span style="white-space: normal"><span >previousSolutions = cell(10, 1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >contPreviousSolutions = 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >nIter = 0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">while </span><span >nIter &lt; threshold</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    fprintf(</span><span style="color: rgb(170, 4, 249);">'...Performing optGene analysis...\n'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%optGene algorithm is run with the following options: target: 'EX_lac__D_e'</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    [~, ~, ~, optGeneSol] = optGene(model, </span><span style="color: rgb(170, 4, 249);">'EX_succ_e'</span><span >, </span><span style="color: rgb(170, 4, 249);">'EX_glc__D_e'</span><span >, selectedGeneList, </span><span style="color: rgb(170, 4, 249);">'MaxKOs'</span><span >, 2, </span><span style="color: rgb(170, 4, 249);">'TimeLimit'</span><span >, 120);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    SET_M1 = optGeneSol.geneList;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >~isempty(SET_M1)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        previousSolutions{contPreviousSolutions} = SET_M1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        contPreviousSolutions = contPreviousSolutions + 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(2, 128, 9);">%printing results</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'optGene found a knockout set of large %d composed by '</span><span >, length(SET_M1));</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">for </span><span >j = 1:length(SET_M1)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">if </span><span >j == 1</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >                fprintf(</span><span style="color: rgb(170, 4, 249);">'%s '</span><span >,SET_M1{j});</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">elseif </span><span >j == length(SET_M1)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >                fprintf(</span><span style="color: rgb(170, 4, 249);">'and %s'</span><span >,SET_M1{j});</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >                fprintf(</span><span style="color: rgb(170, 4, 249);">', %s '</span><span >,SET_M1{j});</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'...Performing coupling analysis...\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        [type, maxGrowth, maxProd, minProd] = analyzeOptKnock(model, optGeneSol.geneList, </span><span style="color: rgb(170, 4, 249);">'EX_succ_e'</span><span >, biomass, 1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'The solution is of type: %s\n'</span><span >,type);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'The maximun growth rate after optimizacion is %.2f\n'</span><span >, maxGrowth);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'The maximun and minimun production of succinate after optimization is %.2f and %.2f, respectively \n\n'</span><span >, minProd, maxProd);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">if </span><span >nIter  ==  1</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            fprintf(</span><span style="color: rgb(170, 4, 249);">'optGene was not able to found an optGene set\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            fprintf(</span><span style="color: rgb(170, 4, 249);">'optGene was not able to found additional optGene sets\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">break</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    nIter = nIter + 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S8'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  class = 'S9'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="8E9103AE" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="18" data-hashorizontaloverflow="false" data-testid="output_4" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">...Performing optGene analysis...</div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="E00C85E1" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="18" data-hashorizontaloverflow="false" data-testid="output_5" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">assuming list is genes</div></div><div class="inlineElement eoOutputWrapper embeddedOutputsErrorElement" uid="6E4C1696" data-scroll-top="null" data-scroll-left="null" data-width="420" data-height="58" data-hashorizontaloverflow="false" data-testid="output_6" style="max-height: 261px; width: 450px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-errorType" style="white-space: normal; font-style: normal; color: rgb(230, 0, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: normal; font-style: normal; color: rgb(230, 0, 0); font-size: 12px;">'gaoptimset' requires Global Optimization Toolbox.</div><div class="diagnosticMessage-stackPart" style="white-space: normal; font-style: normal; color: rgb(230, 0, 0); font-size: 12px;"><br style="white-space: normal; font-style: normal; color: rgb(230, 0, 0); font-size: 12px;">Error in optGene (line 143)<br style="white-space: normal; font-style: normal; color: rgb(230, 0, 0); font-size: 12px;">options = gaoptimset(...</div></div></div></div></div></div><div  class = 'S2'><span style=' font-weight: bold;'>EXAMPLE 2: finding reaction knockouts sets of large 2 or less, using the number of generations to stop optGene</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'\n...EXAMPLE 2: Finding optGene sets\n\n'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >previousSolutions = cell(10, 1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >contPreviousSolutions = 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >nIter = 0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">while </span><span >nIter &lt; threshold</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    fprintf(</span><span style="color: rgb(170, 4, 249);">'...Performing optGene analysis...\n'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(2, 128, 9);">%optGene algorithm is run with the following options: target: 'EX_lac__D_e'</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    [~, ~, ~, optGeneSol] = optGene(model, </span><span style="color: rgb(170, 4, 249);">'EX_succ_e'</span><span >, </span><span style="color: rgb(170, 4, 249);">'EX_glc__D_e'</span><span >, selectedGeneList, </span><span style="color: rgb(170, 4, 249);">'MaxKOs'</span><span >, 2, </span><span style="color: rgb(170, 4, 249);">'Generations'</span><span >, 20);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    SET_M1 = optGeneSol.geneList;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >~isempty(SET_M1)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        previousSolutions{contPreviousSolutions} = SET_M1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        contPreviousSolutions = contPreviousSolutions + 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(2, 128, 9);">%printing results</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'optGene found a knockout set of large %d composed by '</span><span >, length(SET_M1));</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">for </span><span >j = 1:length(SET_M1)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">if </span><span >j == 1</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >                fprintf(</span><span style="color: rgb(170, 4, 249);">'%s '</span><span >,SET_M1{j});</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">elseif </span><span >j == length(SET_M1)</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >                fprintf(</span><span style="color: rgb(170, 4, 249);">'and %s'</span><span >,SET_M1{j});</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >                fprintf(</span><span style="color: rgb(170, 4, 249);">', %s '</span><span >,SET_M1{j});</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'...Performing coupling analysis...\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        [type, maxGrowth, maxProd, minProd] = analyzeOptKnock(model, optGeneSol.geneList, </span><span style="color: rgb(170, 4, 249);">'EX_succ_e'</span><span >, biomass, 1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'The solution is of type: %s\n'</span><span >,type);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'The maximun growth rate after optimizacion is %.2f\n'</span><span >, maxGrowth);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        fprintf(</span><span style="color: rgb(170, 4, 249);">'The maximun and minimun production of succinate after optimization is %.2f and %.2f, respectively \n\n'</span><span >, minProd, maxProd);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">if </span><span >nIter  ==  1</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            fprintf(</span><span style="color: rgb(170, 4, 249);">'optGene was not able to found an optGene set\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">else</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >            fprintf(</span><span style="color: rgb(170, 4, 249);">'optGene was not able to found additional optGene sets\n'</span><span >);</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >        </span><span style="color: rgb(14, 0, 255);">break</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    nIter = nIter + 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: normal"><span >    </span></span></div></div><div class="inlineWrapper"><div  class = 'S12'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div  class = 'S14'><span> </span></div><h2  class = 'S3'><span>TIMING</span></h2><ol  class = 'S4'><li  class = 'S5'><span>EXAMPLE 1: ~ 6 minutes (2 minutes per iteration)</span></li><li  class = 'S5'><span>EXAMPLE 2: ~ 7 minutes (2-3 minutes per iteration)</span></li></ol><h2  class = 'S3'><span>TROUBLESHOOTING</span></h2><div  class = 'S2'><span>1) problem: "optGene didn't find any set"</span></div><div  class = 'S2'><span>possible reason: probably, the limit of time or the number of generations has not been enough. Another explination is that the solver is not suited for solving optGene</span></div><div  class = 'S2'><span>solution: Try with a higher number for inputs "TimeLimit" of "Generations" or using another solver. </span></div><div  class = 'S2'><span>2) problem: "I got an error when running optGene"</span></div><div  class = 'S2'><span>possible reason: the solver is not suited for solving optGene</span></div><div  class = 'S2'><span>solution: Try with another solver</span></div><h2  class = 'S3'><span>ANTICIPATED RESULTS</span></h2><div  class = 'S2'><span>The optGene algorithm will find sets of reactions that should increase the production of your target when they are deleted from the network. Since optGene is based on a genetic algorithm, the solutions found could vary between different runnings, even though the algorithm has been executed with the same input parameters. It is possible that optGene don't find a set of knockouts because the runtime is too short or because the number of generations is too small. In those cases try to increases those input variables. </span></div><h2  class = 'S3'><span>References</span></h2><div  class = 'S2'><span>[1] Patil, K. R., Rocha, I., Förster, J., &amp; Nielsen, J. (2005). Evolutionary programming as a platform for in silico metabolic engineering.</span><span> </span><span style=' font-style: italic;'>BMC bioinformatics</span><span>,</span><span> </span><span style=' font-style: italic;'>6</span><span>(1), 308.</span></div><div  class = 'S2'><span>[2] Orth, J. D., Conrad, T. M., Na, J., Lerman, J. A., Nam, H., Feist, A. M., &amp; Palsson, B. Ø. (2011). A comprehensive genome‐scale reconstruction of Escherichia coli metabolism—2011.</span><span> </span><span style=' font-style: italic;'>Molecular systems biology</span><span>,</span><span> </span><span style=' font-style: italic;'>7</span><span>(1), 535.</span></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% OptGene Tutorial
%% Author: Sebastián N. Mendoza,  Center for Mathematical Modeling, University of Chile. snmendoz@uc.cl
%% *Reviewer(s): Sylvian Arreckx*
%% *INTRODUCTION:*
% In this tutorial we will run optGene For a detailed description of the procedure, 
% please see [1]. Briefly, the problem is to find a set of reactions of size "K" 
% such that when these reactions are deleted from the model, the mutant created 
% will produce a particular target of interest in a higher rate than the wild-type 
% strain. 
% 
% For example, imagine that we would like to increase the production of succinate 
% in Escherichia coli. Which are the knockouts needed to increase the production 
% of succinate? We will approach this problem in this tutorial.
%% MATERIALS
%% EQUIPMENT
%% 
% # MATLAB
% # A solver for QP problems. For example, Gurobi. I encourage the users to 
% use Gurobi since I've not obtained good results using glpk.
%% *EQUIPMENT SETUP*
% Use changeCobraSolver to choose the solver for QP problems. 
%% PROCEDURE
% The proceduce consists on the following steps
% 
% 1) Define contraints (manual task)
% 
% 2) Select a list of reactions or genes (manual task). Reactions or genes in 
% this list could be deleted. Elements that are not in the list will no be deleted. 
% 
% 3) Define some (manual task)
% 
% 4) Run optGene. *TIMING*: This task should take from a few minutes to a few 
% days, depending on the size of your reconstruction and the criterion for stoping 
% optGene

global TUTORIAL_INIT_CB;
if ~isempty(TUTORIAL_INIT_CB) && TUTORIAL_INIT_CB  ==  1
    initCobraToolbox(false) % false, as we don't want to update
    changeCobraSolver('gurobi', 'all');
end

fullPath = which ('tutorial_optGene.mlx');
folder = fileparts(fullPath);
cd(folder);

threshold = 3; 

model = readCbModel('iJO1366.mat');
biomass = 'BIOMASS_Ec_iJO1366_core_53p95M';

%SETTING SPECIFIC CONSTRAINTS
% prespecified amount of glucose uptake 10 mmol/grDW*hr
model = changeRxnBounds(model, 'EX_glc__D_e', -10, 'b');

% Unconstrained uptake routes for inorganic phosphate, sulfate and
% ammonia
model = changeRxnBounds(model, 'EX_o2_e', 0, 'l');
model = changeRxnBounds(model, 'EX_pi_e', -1000, 'l');
model = changeRxnBounds(model, 'EX_so4_e', -1000, 'l');
model = changeRxnBounds(model, 'EX_nh4_e', -1000, 'l');

% The optimization step could opt for or against the phosphotransferase
% system, glucokinase, or both mechanisms for the uptake of glucose
model = changeRxnBounds(model, 'GLCabcpp', -1000, 'l');
model = changeRxnBounds(model, 'GLCptspp', -1000, 'l');
model = changeRxnBounds(model, 'GLCabcpp', 1000, 'u');
model = changeRxnBounds(model, 'GLCptspp', 1000, 'u');
model = changeRxnBounds(model, 'GLCt2pp', 0, 'b');

% Secretion routes  for acetate, carbon dioxide, ethanol, formate, lactate
% and succinate are enabled
model = changeRxnBounds(model, 'EX_ac_e', 1000, 'u');
model = changeRxnBounds(model, 'EX_co2_e', 1000, 'u');
model = changeRxnBounds(model, 'EX_etoh_e', 1000, 'u');
model = changeRxnBounds(model, 'EX_for_e', 1000, 'u');
model = changeRxnBounds(model, 'EX_lac__D_e', 1000, 'u');
model = changeRxnBounds(model, 'EX_succ_e', 1000, 'u');

% FINDING RATES IN WILD-TYPE
% The follling rates are those calculated in the wild-type without any
% mutation.

% determine succinate production and growth rate before optimizacion
fbaWT = optimizeCbModel(model);
growthRateWT = fbaWT.f;

model = changeObjective(model, 'EX_succ_e'); 
fbaWTMin = optimizeCbModel(model, 'min');
fbaWTMax = optimizeCbModel(model, 'max');
minSuccFluxWT = fbaWTMin.f;
maxSuccFluxWT = fbaWTMax.f;

model = changeObjective(model, biomass);

fprintf('The minimum and maximum production of succinate before optimization is %.1f and %.1f respectively\n', minSuccFluxWT, maxSuccFluxWT);
fprintf('The growth rate before optimization is %.2f \n', growthRateWT);

% OPTGENE SETTING
selectedGeneList = {};
% use prespecified reactions. Faster option
selectedRxnList = {'GLCabcpp'; 'GLCptspp'; 'HEX1'; 'PGI'; 'PFK'; 'FBA'; 'TPI'; 'GAPD'; 'PGK'; 'PGM'; 'ENO'; 'PYK'; 'LDH_D'; 'PFL'; 'ALCD2x'; 'PTAr'; 'ACKr'; 'G6PDH2r'; 'PGL'; 'GND'; 'RPI'; 'RPE'; 'TKT1'; 'TALA'; 'TKT2'; 'FUM'; 'FRD2'; 'SUCOAS'; 'AKGDH'; 'ACONTa'; 'ACONTb'; 'ICDHyr'; 'CS'; 'MDH'; 'MDH2'; 'MDH3'; 'ACALD'};
genesByReaction = regexp(regexprep(model.grRules(ismember(model.rxns, selectedRxnList)), '\or|and|\(|\)', ''), '\  ', 'split');
for i = 1:length(genesByReaction)
    selectedGeneList = union(selectedGeneList, genesByReaction{i});
end
%% 
% *I) SUCCINATE OVERPRODUCTION*
% 
% *EXAMPLE 1: finding reaction knockouts sets of large 2 or less, using a limit 
% of time to stop optGene*

fprintf('\n...EXAMPLE 1: Finding optGene sets\n\n')
previousSolutions = cell(10, 1);
contPreviousSolutions = 1;
nIter = 0;
while nIter < threshold
    fprintf('...Performing optGene analysis...\n')
    %optGene algorithm is run with the following options: target: 'EX_lac__D_e'
    [~, ~, ~, optGeneSol] = optGene(model, 'EX_succ_e', 'EX_glc__D_e', selectedGeneList, 'MaxKOs', 2, 'TimeLimit', 120);
    
    SET_M1 = optGeneSol.geneList;
    
    if ~isempty(SET_M1)
        previousSolutions{contPreviousSolutions} = SET_M1;
        contPreviousSolutions = contPreviousSolutions + 1;
        %printing results
        fprintf('optGene found a knockout set of large %d composed by ', length(SET_M1));
        for j = 1:length(SET_M1)
            if j == 1
                fprintf('%s ',SET_M1{j});
            elseif j == length(SET_M1)
                fprintf('and %s',SET_M1{j});
            else
                fprintf(', %s ',SET_M1{j});
            end
        end
        fprintf('\n');
        fprintf('...Performing coupling analysis...\n');
        [type, maxGrowth, maxProd, minProd] = analyzeOptKnock(model, optGeneSol.geneList, 'EX_succ_e', biomass, 1);
        fprintf('The solution is of type: %s\n',type);
        fprintf('The maximun growth rate after optimizacion is %.2f\n', maxGrowth);
        fprintf('The maximun and minimun production of succinate after optimization is %.2f and %.2f, respectively \n\n', minProd, maxProd);
        
    else
        if nIter  ==  1
            fprintf('optGene was not able to found an optGene set\n');
        else
            fprintf('optGene was not able to found additional optGene sets\n');
        end
        break;
    end
    nIter = nIter + 1;
    
end
%% 
% *EXAMPLE 2: finding reaction knockouts sets of large 2 or less, using the 
% number of generations to stop optGene*

fprintf('\n...EXAMPLE 2: Finding optGene sets\n\n')
previousSolutions = cell(10, 1);
contPreviousSolutions = 1;
nIter = 0;
while nIter < threshold
    fprintf('...Performing optGene analysis...\n')
    %optGene algorithm is run with the following options: target: 'EX_lac__D_e'
    [~, ~, ~, optGeneSol] = optGene(model, 'EX_succ_e', 'EX_glc__D_e', selectedGeneList, 'MaxKOs', 2, 'Generations', 20);
    
    SET_M1 = optGeneSol.geneList;
    
    if ~isempty(SET_M1)
        previousSolutions{contPreviousSolutions} = SET_M1;
        contPreviousSolutions = contPreviousSolutions + 1;
        %printing results
        fprintf('optGene found a knockout set of large %d composed by ', length(SET_M1));
        for j = 1:length(SET_M1)
            if j == 1
                fprintf('%s ',SET_M1{j});
            elseif j == length(SET_M1)
                fprintf('and %s',SET_M1{j});
            else
                fprintf(', %s ',SET_M1{j});
            end
        end
        fprintf('\n');
        fprintf('...Performing coupling analysis...\n');
        [type, maxGrowth, maxProd, minProd] = analyzeOptKnock(model, optGeneSol.geneList, 'EX_succ_e', biomass, 1);
        fprintf('The solution is of type: %s\n',type);
        fprintf('The maximun growth rate after optimizacion is %.2f\n', maxGrowth);
        fprintf('The maximun and minimun production of succinate after optimization is %.2f and %.2f, respectively \n\n', minProd, maxProd);
        
    else
        if nIter  ==  1
            fprintf('optGene was not able to found an optGene set\n');
        else
            fprintf('optGene was not able to found additional optGene sets\n');
        end
        break;
    end
    nIter = nIter + 1;
    
end
%% 
% 
%% TIMING
%% 
% # EXAMPLE 1: ~ 6 minutes (2 minutes per iteration)
% # EXAMPLE 2: ~ 7 minutes (2-3 minutes per iteration)
%% TROUBLESHOOTING
% 1) problem: "optGene didn't find any set"
% 
% possible reason: probably, the limit of time or the number of generations 
% has not been enough. Another explination is that the solver is not suited for 
% solving optGene
% 
% solution: Try with a higher number for inputs "TimeLimit" of "Generations" 
% or using another solver. 
% 
% 2) problem: "I got an error when running optGene"
% 
% possible reason: the solver is not suited for solving optGene
% 
% solution: Try with another solver
%% ANTICIPATED RESULTS
% The optGene algorithm will find sets of reactions that should increase the 
% production of your target when they are deleted from the network. Since optGene 
% is based on a genetic algorithm, the solutions found could vary between different 
% runnings, even though the algorithm has been executed with the same input parameters. 
% It is possible that optGene don't find a set of knockouts because the runtime 
% is too short or because the number of generations is too small. In those cases 
% try to increases those input variables. 
%% References
% [1] Patil, K. R., Rocha, I., Förster, J., & Nielsen, J. (2005). Evolutionary 
% programming as a platform for in silico metabolic engineering. _BMC bioinformatics_, 
% _6_(1), 308.
% 
% [2] Orth, J. D., Conrad, T. M., Na, J., Lerman, J. A., Nam, H., Feist, A. 
% M., & Palsson, B. Ø. (2011). A comprehensive genome‐scale reconstruction of 
% Escherichia coli metabolism—2011. _Molecular systems biology_, _7_(1), 535.
##### SOURCE END #####
-->
</div></body></html>